<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ChatroomUser extends Model
{
    //
    protected $table = 'chatroom_user';

    protected function getDateFormat()
    {
        return 'U';
    }

    protected $guarded = [''];

    /**
     *获取关联的用户
     */
    public function user()
    {
        return $this->belongsTo('App\Models\User', 'uid', 'uid');
    }


    public function chatroom()
    {
        return $this->belongsTo('App\Models\Chatroom', 'chatroom_id', 'id');
    }


}
